import sketch.MethodChoice;
import sketch.OracleChoice;
import sketch.ValueChoice;
import sketch.generator.GenTests;
import sketch.generator.SequenceGenerator;
import sketch.generator.ValueGenerator;
import sketch.subject.TreeMap;
import junit.framework.TestCase;



public class TreeMapTestSketch2 extends TestCase {
	
	public void testStatefulSketch() {
		String testPath = "/scratch/eclipseworkspace/SketchSeq/examples/TreeMapSketchExecution.java";
		GenTests genTests = new GenTests(testPath);
		GenTests.reset(TreeMap.class);
		
		/**
		 * Sketch begins
		 * */
		Object treemap = new TreeMap();
		
		ValueGenerator<Integer> intPool = ValueChoice.getIntRange(1, 1);
		SequenceGenerator<? extends Object> putGenerator
		    = MethodChoice.permute(treemap, "put(int)", intPool);
		
		ValueGenerator<?> removeArgs = ValueChoice.randomChoose(3, intPool);
		SequenceGenerator<? extends Object> removeGenerator
		    = MethodChoice.inorder(treemap, "remove(int)", removeArgs);
		
		ValueGenerator<?> containArgs = ValueChoice.randomChoose(3, intPool);
		SequenceGenerator<? extends Object> observeKeyGenerator
		    = OracleChoice.observeMethodOutput(treemap, "containsKey(int)", containArgs, false);
		
		SequenceGenerator<? extends Object> printGenerator = MethodChoice.choose(treemap, "print()");
		
		/**
		 * Sketch ends
		 * */
		genTests.addGenerator(putGenerator);
		genTests.addGenerator(removeGenerator);
		genTests.addGenerator(observeKeyGenerator);
		genTests.addGenerator(printGenerator);
		genTests.genTests();
	}
	
}
